var entityCollection = require('../../../Base/server/controllers/EntityCollection');

//质检类型
exports.QCType = {
    FullReview: {Value: 0, Text: '全检'},
    Inspection: {Value: 1, Text: '巡检'},
    FirstQuality: {Value: 2, Text: '首件质检'}
};

//质检指标类型
exports.QCNormType = {
    FullReview: {Value: 0, Text: '数值'},
    Inspection: {Value: 1, Text: '字符'},
    FirstQuality: {Value: 2, Text: '布尔'},
    Select: {Value: 3, Text: '选择'}
};

//质检状态
exports.QCStatus = {
    Qualified: {Value: 0, Text: '合格'},
    NotQualified: {Value: 1, Text: '不合格'},
    Concession: {Value: 2, Text: '让步接收'},
    Decide: {Value: 3, Text: '品质判定'},
    Rework: {Value: 4, Text: '返工'},
    Scrap: {Value: 5, Text: '报废'},
    Special: {Value: 6, Text: '特裁'}
};

//查找所有的不同的枚举信息
exports.findAllExtendEnum = function (code,completeFun) {
    
    var entity = entityCollection.getEntity("ExtendEnum");

    entity.findOne({Code: code}, null,
      function(err, record) {
        if (err) {
            var newErr = new Error();
            newErr.leval = 9;
            newErr.title = '查询枚举信息错误';
            newErr.message = '请检查查询参数！';
            completeFun(newErr);
        } else {
            completeFun(null, record);
        }
    });
};
